package net.xo68.coordinator.core.gid;

import lombok.Data;
import lombok.ToString;

import java.io.Serializable;
import java.util.Objects;

/**
 * 获取最新编号的请求
 * @author wuxie
 * @version 2020-9-28
 */
@ToString
@Data
public class NewIdRequest implements Serializable {
    /**
     * 编号的键
     */
    private long idKey;

    public NewIdRequest() {
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        NewIdRequest that = (NewIdRequest) o;
        return idKey == that.idKey;
    }

    @Override
    public int hashCode() {
        return Objects.hash(idKey);
    }
}
